
# 第二阶段1：第二阶段第1批执行的脚本，最好逐个执行，主要为模板等基础格式处理，且执行顺序处于【v-fund二期-1.sql】后

# 0 【回/付款单es增量处理】ES增量处理（最先）
# 同步从updateTimeGte开始新增的数据
# 编写者 张传鹏
# 0.1 【增量处理】回款单es增量
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":702,"byCorpid":0, "updateTimeGte": 1590750000}'

# 0.2 【增量处理】付款单es增量
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid": "1","userId" : "1","platform":"web","saasMark":1,"businessType":802,"byCorpid":0, "updateTimeGte": 1590750000}'

# 1 资金菜单模板处理
# 可重复执行
# 编写者 张传鹏
# codeReview者
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/menu/init -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","corpid":"1","userId":"1","xbbCode":123456,"platform":"web","saasMark":1}'

# 2 表单解释相关
# 2.1 付款单解释
# 编写者 张传鹏
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/sheet/paySheet/explains -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456"}'

# 2.2 付款计划模版脚本
# 编写者 陈山
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/purchasePayplan/explains -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"801"}'

# 2.3 采购合同模版脚本
# 编写者 陈山
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/purchasePayplan/explains -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"1101"}'

# 2.4 采购退货刷解释脚本
# 编写者 周伟强
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/returnedPurchase/explains -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessTypes":[1201]}'

# 2.5 回款单模板解释：收款账户、支付方式、负责人、协同人处理
# 可重复执行
# 编写者 张传鹏
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/sheet/paymentSheet/explains/some -X POST -H 'Content-type: application/json' -d '{"frontDev": "1","xbbCode": 123456}'

# 2.6 回款计划模版处理(主要是隐藏了回款状态的高级可编辑属性)
# 编写者 陈山
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/payment/updatePayment -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","attrList":["text_3","num_2","num_3","num_8","num_4","ownerId"],"businessType":701,"frontDev":"1","xbbCode":"123456"}'

# 2.7 进项发票给旧公司刷form
# 编写者 余乾
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/module/purchaseInvoice -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","platform":"web","frontDev":"1","xbbCode":"123456"}'

# 2.8 预付款表单和表单解释
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/menu/initForm -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web"}'

# 3 采购合同流程表单解释
# 编写者 陈山
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/flow/form/contract -X POST -H 'Content-type: application/json' -d '{"xbbCode":123456,"businessType":"1101","operate":"0"}'

# 4 新增付款计划的坏账分组脚本
# 编写者 陈山
# 想要重复执行该新增坏账脚本的话就需要执行sql：
# UPDATE tb_paas_list_group SET del = 1,update_time = UNIX_TIMESTAMP() where default_group_code=112 and del=0;###

curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/purchasePayplan/scriptTab -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"801"}'

# 5 新增付款计划/采购合同/供应商的开票历史脚本
# 编写者 陈山
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/purchasePayplan/scriptDetailTab -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessTypeList":[801,1101,1001],"operate":"0"}'

# 6 采购合同tab名称修改(付款记录-->付款管理，类型有变动)
# 编写者 陈山
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/detail/tab/byType -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"1101","operate":"0"}'

# 7 供应商tab名称修改(付款记录-->付款管理，类型有变动)
# 编写者 陈山
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/detail/tab/byType -X POST -H 'Content-type: application/json' -d '{"xbbCode":"123456","businessType":"1001","operate":"0"}'

# addTime以前置处理时间为准 注意前置后置处理增量传参addTime必须一致
# 8 【增量处理】：初始化公司资金账户
# 编写者 周伟强
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/init/fund/account -X POST -H 'Content-type: application/json' -d '{"addTime":1590750000,"xbbCode":123456,"corpid": "1","greaterOrLess":1}'

# 9【增量处理】 初始化回款单资金账户字段
# 编写者 周伟强
curl  http://pt2jobs.xbongbong.com.cn/pro/v1/script/fund/init/paymentSheet/account -X POST -H 'Content-type: application/json' -d '{"addTime":1590750000,"xbbCode":123456,"corpid": "1","greaterOrLess":1}'

